/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.front.entity.cart;

import java.math.BigDecimal;

import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;

import com.thinkgem.jeesite.common.persistence.DataEntity;
import com.thinkgem.jeesite.modules.product.entity.product.GenProduct;

/**
 * 购物车Entity
 * @author Egan
 * @version 2016-12-15
 */
public class GenCart extends DataEntity<GenCart> {
	
	private static final long serialVersionUID = 1L;
	private Long accountid;// accountid
	
	private long amt; // amt
	
	private String productid;		// productid
	
	private String productName;    //产品名称
	
	private String picture; //住图片
	
	private double price;//价格
	
	private BigDecimal price2;//价格
	
	private long stock; //库存
	
	private String brand;//商标
	
	private String introduce;//简介
	
	private String associateStr;//关联商品
	
	private String detail;//介绍
	
	private String productHTML;//参数
	
	private String code;
	
	private GenProduct genProduct;
	
	public GenCart() {
		super();
	}

	public GenCart(String id){
		super(id);
	}

	@NotNull(message="accountid不能为空")
	public Long getAccountid() {
		return accountid;
	}

	public void setAccountid(Long accountid) {
		this.accountid = accountid;
	}
	
	@Length(min=0, max=64, message="productid长度必须介于 0 和 64 之间")
	public String getProductid() {
		return productid;
	}

	public void setProductid(String productid) {
		this.productid = productid;
	}

	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	public String getPicture() {
		return picture;
	}

	public void setPicture(String picture) {
		this.picture = picture;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public BigDecimal getPrice2() {
		return new BigDecimal(getPrice()).setScale(2, BigDecimal.ROUND_HALF_UP);
	}

	public void setPrice2(BigDecimal price2) {
		this.price2 = new BigDecimal(getPrice()).setScale(2, BigDecimal.ROUND_HALF_UP);
	}

	public long getAmt() {
		return amt;
	}

	public void setAmt(long amt) {
		this.amt = amt;
	}

	public long getStock() {
		return stock;
	}

	public void setStock(long stock) {
		this.stock = stock;
	}

	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	public String getIntroduce() {
		return introduce;
	}

	public void setIntroduce(String introduce) {
		this.introduce = introduce;
	}

	public String getAssociateStr() {
		return associateStr;
	}

	public void setAssociateStr(String associateStr) {
		this.associateStr = associateStr;
	}

	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}

	public String getProductHTML() {
		return productHTML;
	}

	public void setProductHTML(String productHTML) {
		this.productHTML = productHTML;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

    public GenProduct getGenProduct() {
        return genProduct;
    }

    public void setGenProduct(GenProduct genProduct) {
        this.genProduct = genProduct;
    }
}